//
//  ThreeTableViewCell_material.m
//  ProjectA_LK
//
//  Created by 萌萌的小坤坤 on 16/6/16.
//  Copyright © 2016年 冷坤. All rights reserved.
//

#import "ThreeTableViewCell_material.h"
#import "UIImageView+WebCache.h"
@implementation ThreeTableViewCell_material
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatTabView];
    }
    return self;
}
- (void)creatTabView{
    self.picImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 375, 667 / 3.5)];
    self.picImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.picImage];
    [_picImage release];
    
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, self.picImage.frame.size.height - 30, self.picImage.frame.size.width, 20)];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    self.titleLabel.textColor = [UIColor whiteColor];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
}

- (void)setModels:(Topic *)models{
    if (_models != models) {
        [_models release];
        _models = [models retain];
    }
    
    [self.picImage sd_setImageWithURL:[NSURL URLWithString:models.host_pic]];
    self.titleLabel.text = models.topic_name;
    
}

@end
